package ioc

// IOC 容器
type Container struct {
	_Objs map[string]any
}

func NewContainer(objs map[string]any) *Container {
	return &Container{_Objs: objs}
}

// 获取 name 关联的对象并返回
func (_container *Container) Get(name string) any {
	obj, ok := _container._Objs[name]

	if !ok {
		return nil
	}

	return obj
}
